import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// 动画库
import 'animate.css'

// 按需引入组件
import {
  Button, Popup, Cell, CellGroup,
  Grid, GridItem, SwipeCell, Tab, Tabs,
  Swipe, SwipeItem, Toast, Sidebar,
  SidebarItem, Loading, Field, Form,
  Slider , ShareSheet 

} from 'vant';
Vue.use(Popup)
  .use(Cell)
  .use(CellGroup)
  .use(Grid)
  .use(GridItem)
  .use(SwipeCell)
  .use(Sidebar)
  .use(SidebarItem)
  .use(Tab)
  .use(Tabs)
  .use(Swipe)
  .use(SwipeItem)
  .use(Toast)
  .use(Loading)
  .use(Form)
  .use(Button)
  .use(Slider)
  .use(ShareSheet)
  .use(Field);

// 图片懒加载
import VueLazyload from 'vue-lazyload'
Vue.use(VueLazyload, {
  preLoad: 1.3,
  loading: require('./assets/img/book_cover.jpg'),
  error: require('./assets/img/book_cover.jpg'),
  attempt: 1,
});
Vue.config.productionTip = false
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
